<?php
        // output messages
        $messages = Session::instance()->get('messages');
        Session::instance()->delete('messages');
?>
<div id="panel-info"<?php if(empty($messages) && $messages_user_unread == 0) { echo ' class="hide"'; } ?>>
          <div id="panel-info-body">
            <?php
              if(!empty($messages)) {
                 foreach($messages as $type => $messages) {
                    foreach($messages as $message) {
                       echo '<p class="'.$type.'"><img src="/media/img/icons/'.$type.'.png" alt="" />'.$message.'</p>';
                    }
                 }
              }              
            ?>
            <?php if($messages_user_unread > 0): ?>
            <p><img src="/media/img/icons/mail.png" alt="" /><a href="<?php echo url::base(); ?>messages/view" title="Máte nepřečtené zprávy">Máte <strong><?php echo $messages_user_unread ?></strong> <?php if ($messages_user_unread == 1): ?>neprečtenou zprávu.<?php endif ?><?php if ($messages_user_unread > 1 && $messages_user_unread < 5): ?>neprečtené zprávy.<?php endif ?><?php if ($messages_user_unread > 4): ?>neprečtených zpráv.<?php endif ?></a></p>
            <?php endif ?>
            <a href="javascript:;" id="close-info-panel-top" class="button-right" title="">zavřít<span></span></a>
          </div>
        </div>
<?php if (! Auth::instance()->logged_in()): ?>
<div id="panel-login">
          <div id="panel-login-body">
<?php

if(!isset($post)) {
   $post = array('username' => 'jonny', 'password' => 'heslo');
}
?>
            <form id="login" action="<?php echo url::base(); ?>user/login" method="post" accept-charset="utf-8">
              <ul>
                <li><?php echo Form::input('username', $post['username'], array('class' => 'text')) ?></li><li><?php echo Form::password('password', $post['password'], array('class' => 'text')) ?></li>
                <li class="submit"><?php echo Form::submit(NULL, 'Přihlásit se', array('class' => 'button-dark-submit')); ?><input type="checkbox" id="remember" name="remember" value="true" /><label for="remember">Zapamatovat si mě</label></li>
              </ul>
            </form>
            <!-- <a href="<?php echo url::base(); ?>user/reset">Forgot your username or password?</a>-->
            <a href="javascript:;" id="close-login-panel-top" class="button-right" title="">zavřít<span></span></a>
          </div>
        </div>
<?php endif ?>
